package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.aspect.AutoFillAspect;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    /**
     * 菜品口味批量插入
     * @param flavors
     * @return
     */
    @AutoFill(OperationType.INSERT)
    void insertBatch(List<DishFlavor> flavors);

    @Delete("delete from sky_take_out.dish_flavor where id = #{dishId}")
    void deleteByDishId(Long dishId);

    void deleteByDishIds(List<Long> dishIds);

    @Select("select * from sky_take_out.dish_flavor where id =#{dishId}")
    List<DishFlavor> getByDishId(Long dishId);
}
